package cn.itcast.bos.quartz;

import java.util.Date;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import cn.itcast.bos.quartz.service.PromotionService;
import cn.itcast.bos.service.take_delivery.WayBillService;

public class PromotionJob implements Job {

	@Autowired
	private PromotionService promotionService;
	
	@Autowired
	private WayBillService wayBillService;

	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		System.err.println("更新活动过期正在进行...间隔1小时");
		promotionService.update(new Date());
		System.err.println("索引库更新啦...间隔24小时");
		wayBillService.syncIndex();
	}

}
